
import Button from './Button/src/index'
import Toast from './Toast/src/index'
import Field from './Field/src/index'
import Popup from './Popup/src/index'
import Picker from './Picker/src/index'
import Radio from './Radio/src/index'
import Checkbox from './Checkbox/src/index'
import ImagePreview from './ImagePreview/src/index'

const components = [
  Button,
  Toast,
  Field,
  Popup,
  Radio,
  Checkbox,
  ImagePreview
]

const install = function(Vue:any):void {
  components.map(component => Vue.component(component.name, component))
  Vue.prototype.$toast = Toast;
}

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {
  install,
  Button,
  Toast,
  Field,
  Popup,
  Picker,
  Radio,
  Checkbox,
  ImagePreview
}
